﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="ArticleAdd.aspx.cs"
    Inherits="Fjaspx.UI.Web.Admin.Article.ArticleAdd" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" href="../CSS/sys.css" />
    <script src="../../JavaScript/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" language="JavaScript" src="../js/calendar.js"></script>
    <link href="../CSS/calendar.css" type="text/css" rel="stylesheet" />
    <script src="../js/prototype.js" type="text/javascript"></script>
    <script src="../js/js_class.js" type="text/javascript"></script>
    <script src="../../configuration/js/public.js" type="text/javascript"></script>
    <script src="../../configuration/js/Prototype.js" type="text/javascript"></script>
    <script type="text/javascript">
        var jsObj = new js_Class();
        function showDiv(divId) {
            jsObj.displayDiv(divId);
        }
        function isNumber(inputNum) {
            if (!jsObj.isNumber(inputNum)) {
                alert("请输入数字");
                $("hits_text").select();
                return false;
            }
        }
        //        function checkDateTime(obj) {
        //            var str = obj.value;
        //            var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
        //            if (r == null) {
        //                alert('发现异常！输入的时间格式不符合要求，请输入格式如：2007-12-12');
        //                obj.value = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();
        //                return false;
        //            }
        //            var d = new Date(r[1], r[3] - 1, r[4]);
        //            if (!(d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4])) {
        //                alert('发现异常！输入的时间格式不符合要求，请输入格式如：2007-12-12');
        //                obj.value = new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate();
        //                return false;
        //            }
        //        }
        function checkVal() {
            if (jsObj.checkValueEmpty($("title_text")))
            { alert("请输入文章标题！"); return false; }
            if ($("title_text").value.length < 4) {
                alert("对不起！输入的文章标题字数不足，至少4个！");
                return false;
            }
            if (jsObj.checkValueEmpty($("artDes_text")))
            { alert("请输入文章简介和文章内容！"); return false; }
            if (jsObj.checkValueEmpty($("artKeyword_text")))
            { alert("请输入文章关键字(方便搜索查询等)！"); return false; }
        }
        var URLParams = new Array();
        var aParams = document.location.search.substr(13).split('&');
        for (i = 0; i < aParams.length; i++) {
            var aParam = aParams[i].split('=');
            URLParams[aParam[0]] = aParam[1];
        }
        var classIdTemp = '1';
        classIdTemp = URLParams["Class_ID"];
        function load(channelId) {
            $("channelId_droplistVal").value = $("channelId_droplist").value;
            if ($("isPic_text").checked) {
                Element.show("upThing");
            }
            else {
                Element.hide("upThing");
            }
            for (i = $("classId_droplist").length; i >= 0; i--) {
                $("classId_droplist").options.remove(i);
            }
            var clearCache = new Date().getTime();
            var url = "ClassList.aspx";
            var pars = "channelId=" + channelId + "&par=" + clearCache;
            var myAjax = new Ajax.Request(url, { method: 'get', parameters: pars, onComplete: showResponse }); //更新记录
        }

        function showResponse(originalRequest)//处理返回信息
        {

            var selectIndexVal = 0;
            var strs = originalRequest.responseText;
            if (strs != "") {
                var strArray = strs.split(",");
                for (var i = 0; i < strArray.length; i++) {
                    var aryf = strArray[i].toString().split("|");
                    $("classId_droplist").options.add(new Option(aryf[0].toString(), aryf[1].toString()));
                    if (aryf[1].toString() == classIdTemp) {
                        selectIndexVal = i;
                    }
                }
                $("classId_droplist").options.selectedIndex = selectIndexVal;
                $("classId_droplistVal").value = $("classId_droplist").value;
            }
        }
        function onChangeVal() {
            $("classId_droplistVal").value = $("classId_droplist").value;
        }
    </script>
    <style type="text/css">
        .hy
        {
            behavior: url(../CSS/Content.htc);
            background: #DFEEFD;
        }
        .hy tr td
        {
            background: white;
        }
        .hy .overStyle td
        {
            background: #F2F8FE;
        }
        .hy .outStyle td
        {
            background: #FFFFFF;
        }
    </style>
</head>
<body onload="load($('channelId_droplist').value)">
    <form id="form1" runat="server">
    <div>
        <table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="#DFEEFD">
            <tr>
                <td height="30" valign="bottom">
                    &nbsp;&nbsp;<img src="../images/localGIF.gif" />&nbsp;<span style="font-size: 12px;
                        color: #005097">后台管理 >> 添加文章 </span>
                </td>
            </tr>
        </table>
        <table bgcolor="#5D8FB2" border="0" width="100%" cellpadding="1" cellspacing="1"
            class="hy">
            <tr class="Tr">
                <td align="right" width="105">
                    所属频道：<font color="red">*</font>
                </td>
                <td>
                    <asp:DropDownList ID="channelId_droplist" runat="server">
                    </asp:DropDownList>
                    &nbsp;
                    <input id="channelId_droplistVal" type="hidden" runat="server" />
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    所属类别：<font color="red">*</font>
                </td>
                <td>
                    <asp:DropDownList ID="classId_droplist" runat="server">
                    </asp:DropDownList>
                    &nbsp;
                    <input id="classId_droplistVal" type="hidden" runat="server" />
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    所在区域：<font color="red">*</font>
                </td>
                <td>
                    <div id="div2" class="Description">
                        <asp:TextBox ID="tbArea" runat="server" ReadOnly></asp:TextBox>
                        <asp:HiddenField runat="server" ID="ClassID" />
                        <label id="Label1" runat="server">
                            <img src="../images/ss.gif" alt="选择栏目" border="0" style="cursor: pointer;" onclick="selectFile('batchArea',new Array(<%=ClassID.ClientID %>,<% =tbArea.ClientID%>),250,500);<% =tbArea.ClientID%>.focus();" /></label>
                    </div>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    标题：<font color="red">*</font>
                </td>
                <td>
                    <asp:TextBox ID="title_text" runat="server" class="input" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    副标题：
                </td>
                <td>
                    <asp:TextBox ID="subtitle_text" runat="server" class="input" MaxLength="20"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    作者：
                </td>
                <td>
                    <asp:TextBox ID="author_text" runat="server" class="input" MaxLength="20"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    文章发布者：
                </td>
                <td>
                    <asp:TextBox ID="inputerl_text" runat="server" class="input" MaxLength="20"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    文章来源：
                </td>
                <td>
                    <asp:TextBox ID="artFrom_text" runat="server" class="input" MaxLength="20" Width="292px"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    链接地址：
                </td>
                <td>
                    <asp:TextBox ID="artUrl_text" runat="server" class="input" MaxLength="80" Width="292px"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    文章简介：<font color="red">*</font>
                </td>
                <td>
                    <asp:TextBox ID="artDes_text" runat="server" Height="149px" Width="384px" class="input"
                        TextMode="MultiLine" MaxLength="1000"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" height="24" bgcolor="#D7E3F3">
                    文章内容：<font color="red">*</font>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <FCKeditorV2:FCKeditor runat="server" ID="FCKeditor1" BasePath="~/fckeditor/" Height="300px">
                    </FCKeditorV2:FCKeditor>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    文章关键字：<font color="red">*</font>
                </td>
                <td>
                    <asp:TextBox ID="artKeyword_text" runat="server" class="input" MaxLength="50" Width="293px"></asp:TextBox>&nbsp;&nbsp;(提示:多个关键词请用<font
                        color='red'> | </font>分隔)<font color='#6C9D9D'></font>
                </td>
            </tr>
            <tr class="Tr" style="display: none">
                <td align="right">
                    点击率：
                </td>
                <td>
                    <asp:TextBox ID="hits_text" runat="server" Text="0" class="input" MaxLength="10"
                        Width="55px"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    创建时间：
                </td>
                <td>
                    <asp:TextBox ID="createDate_text" runat="server" class="input" MaxLength="30" Width="156px"
                        onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    更新时间：
                </td>
                <td>
                    <asp:TextBox ID="modiDate_text" runat="server" class="input" MaxLength="30" Width="156px"
                        onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"></asp:TextBox>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    是否含缩略图片：
                </td>
                <td>
                    <asp:CheckBox ID="isPic_text" runat="server" Text="是否包含图片" onclick="showDiv('upThing');" />
                </td>
            </tr>
            <tr id="upThing">
                <td colspan="2" bgcolor="#EEF6FB">
                    &nbsp;缩略图片路径：<asp:TextBox ID="picPath" runat="server" MaxLength="100" Width="200px"
                        class="input"></asp:TextBox>
                    &nbsp;&nbsp;&nbsp;请选择你所要上传的图片：
                    <iframe id="I2" frameborder="0" height="25px" name="I2" scrolling="no" src="IframUpLoad.aspx?img=picPath"
                        width="300px"></iframe>
                    &nbsp; <font color="red">*</font>
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    是否置顶：
                </td>
                <td>
                    <asp:CheckBox ID="isTop_cbox" runat="server" Text="是否置顶" Checked="true" />
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    是否推荐：
                </td>
                <td>
                    <asp:CheckBox ID="isTj_cbox" runat="server" Text="是否推荐" Checked="true" />
                </td>
            </tr>
            <tr class="Tr">
                <td align="right">
                    文章当前状态：
                </td>
                <td>
                    <asp:CheckBox ID="stateNow_lable" Checked="True" runat="server" Text="已审核" />
                </td>
            </tr>
            <%--            <tr class="Tr">
                <td align="right" >
                    是否分页：</td>
                <td>
                    <asp:CheckBox ID="isPage_cbox" runat="server" Text="是否分页" />
                </td>
            </tr>
            <tr class="Tr">
                <td align="right" >
                    分页时每页显示最多字符：</td>
                <td>
                    <asp:TextBox ID="maxperpage_text" runat="server"   class="input" MaxLength="10" 
                        Width="45px">maxperpage_text</asp:TextBox>
                </td>
            </tr>--%>
            <tr>
                <td colspan="2" align="center" height="50">
                    <asp:Button ID="addArtBtn" runat="server" Text="添加文章" OnClick="addArtBtn_Click" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
